// 	Name: 07.c
//	Description: Chapter 5 project 7
//	Author: StableGenius
//	Date: 2020-05-07
//	Email: feng@dongfa.pro

#include <stdio.h>

int main(void)
{
	int n1, n2, n3, n4, max12, min12, max34, min34, max, min;

    printf("Enter four integers: ");
    scanf("%d%d%d%d", &n1, &n2, &n3, &n4);
    
    if (n1 > n2){
		max12 = n1;
		min12 = n2;
    } else {
		max12 = n2;
		min12 = n1;
    }
    
    if (n3 > n4){
		max34 = n3;
		min34 = n4;
    } else {
		max34 = n4;
		min34 = n3;
    }
    
    if (max12 > max34){
		max = max12;
    } else {
		max = max34;
    }
    
    if (min12 < min34){
		min = min12;
    } else {
		min = min34;
    }

    printf("Largest: %d\n", max);
    printf("Smallest: %d\n", min);

	return 0;
}
